﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ViewInventory.aspx.cs" Inherits="Inventory_ViewInventory" Title="库存管理" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width:100%" cellpadding="1" cellspacing="1">
    <tr>
        <td>
            <table>
                <tr>
                    <td>
                        <asp:Localize ID="Localize1" runat="server" 
                            meta:resourcekey="Localize1Resource1" Text="产品类别"></asp:Localize>
                    </td>
                    <td>
                            <asp:DropDownList ID="DrpProductTypeList" runat="server" AutoPostBack="True" 
                                DataSourceID="ObjectDataSource_ProductType" DataTextField="ProductTypeName" 
                                DataValueField="ProductTypeCode" Width="140px" 
                                OnSelectedIndexChanged="DrpProductTypeList_SelectedIndexChanged" 
                                meta:resourcekey="DrpProductTypeListResource1"  >
                            </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Localize ID="Localize2" runat="server" 
                            meta:resourcekey="Localize2Resource1" Text="产品代码"></asp:Localize>
                    </td>
                    <td>
                        <asp:TextBox ID="TextBoxFindCode" runat="server" 
                            meta:resourcekey="TextBoxFindCodeResource1"></asp:TextBox>
                    </td>
                    <td>
                        <asp:Button ID="ButtonFind" runat="server" Text="查找" OnClick="ButtonFind_Click" 
                            meta:resourcekey="ButtonFindResource1" />
                    </td>
                </tr>
            </table>
            <asp:Button ID="ButtonWarehouseList" runat="server" Text="新增入库单" 
                OnClick="ButtonWarehouseList_Click" 
                meta:resourcekey="ButtonWarehouseListResource1" />
            <asp:Button ID="ButtonDeliveredSheet" runat="server" OnClick="ButtonDeliveredSheet_Click"
                Text="新增出库单" meta:resourcekey="ButtonDeliveredSheetResource1" />
            <asp:Button ID="ButtonHistory" runat="server" OnClick="ButtonHistory_Click" 
                Text="查看历史记录" meta:resourcekey="ButtonHistoryResource1" /></td>
    </tr>
    <tr>
        <td>
            <table border="1" width ="100%">
                <tr>
                    <td valign="top">
                            <asp:GridView ID="GridViewInventory" runat="server"  SkinId="DataCollections_View"
                                 AllowPaging="True" AllowSorting="True" 
                                 AutoGenerateColumns="False" DataKeyNames="ProductID,WarehouseID" DataSourceID="ObjectDataSource_Inventory" 
                                meta:resourcekey="GridViewInventoryResource1" 
                                onsorting="GridViewInventory_Sorting">
                            
                            <Columns>
                                <asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False"
                                    ReadOnly="True" SortExpression="ProductID" Visible="False" 
                                    meta:resourcekey="BoundFieldResource1" />
                                <asp:BoundField DataField="ProductCode" HeaderText="产品代码" 
                                    SortExpression="ProductCode" meta:resourcekey="BoundFieldResource2" />
                                <asp:BoundField DataField="ProductName" HeaderText="产品名称" 
                                    SortExpression="ProductName" meta:resourcekey="BoundFieldResource3" />
                                <asp:BoundField DataField="Quantity" HeaderText="数量" SortExpression="Quantity" 
                                    meta:resourcekey="BoundFieldResource4" />
                                <asp:BoundField DataField="WarehouseID" HeaderText="WarehouseID" SortExpression="WarehouseID"
                                    Visible="False" meta:resourcekey="BoundFieldResource5" />
                                <asp:BoundField DataField="WarehouseName" HeaderText="仓库" 
                                    SortExpression="WarehouseName" meta:resourcekey="BoundFieldResource6" />
                                <asp:BoundField DataField="ProductModule" HeaderText="型号" 
                                    meta:resourcekey="BoundFieldResource7"  />
                                <asp:BoundField DataField="ProductColor" HeaderText="颜色" 
                                    meta:resourcekey="BoundFieldResource8"  />
                            </Columns>
                        </asp:GridView>
                    </td>  
                         
                </tr>
            </table>
            
        </td>
    </tr>
</table>  


    <asp:ObjectDataSource ID="ObjectDataSource_Inventory" runat="server" 
        SelectMethod="GetInventoryView" TypeName="InventoryBL">
        <SelectParameters>
            <asp:ControlParameter ControlID="DrpProductTypeList" DefaultValue="" 
                Name="productcode" PropertyName="SelectedValue" Type="String" />
            <asp:Parameter DefaultValue="ProductCode" Name="orderby" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="ObjectDataSource_ProductType" runat="server" 
                                SelectMethod="GetAllProductTypes" TypeName="SystemBL">
    </asp:ObjectDataSource>
                            
</asp:Content>

